package org.esgl3d.spatial;

import java.util.ArrayList;

import org.esgl3d.rendering.RenderQueue;
import org.esgl3d.scene.CameraNode;
import org.esgl3d.scene.Scene;
import org.esgl3d.scene.SceneNode;

public class NoneSpatialStructure implements SpatialStructure {

	private final Scene attachedScene;
		
	public NoneSpatialStructure(Scene scene) {
		attachedScene = scene;
	}
	
	@Override
	public void getVisibleNodes(CameraNode cam, RenderQueue queue) {
		for (SceneNode curNode : attachedScene.getChildren())
			renderNode(queue, curNode);
	}
	
	private void renderNode(RenderQueue queue, SceneNode node) {
		queue.add(node);
		if (node.hasChildren()) {
			ArrayList<SceneNode> childs = node.getChildren();
			for(SceneNode curNode : childs) {
				renderNode(queue, curNode);
			}
		}
	}

	@Override
	public void rebuild() {
		// TODO Auto-generated method stub

	}

	@Override
	public void update(SceneNode node) {
		// TODO Auto-generated method stub

	}

}
